<!doctype html>
<html>

	<head>
		<meta charset="utf-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
	</head>

	<body>
		
		<script type="text/javascript">
			
			// 获取字符串中出现次数最多的字符
			// 如  repeatCount("aaabbbbcccddd")  返回结果:{b:4}	
				
			function repeatCount(str){
				var max = 0;
				var char = "";
				for(var i = 0; i < str.length; i++){
					var len = str.split(str.charAt(i).length - 1);
					if(max < len){
						max = len;
						char  = str.charAt(i);
					}else if(max == len){
						if(char.split(ste.charAt(i)).length - 1 == 0){
							char = str.charAt(i)
						}
					}
				}
				return char + ":" + max;
				console.log(char)
			}
			
			repeatCount("aaabbbbcccddd")
			
		</script>
	</body>

</html>
